﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Media.MediaProperties;
using Windows.UI.Xaml.Data;

namespace Microsoft.Media.CaptureClient.Sample.Converters
{
    public class MediaRatioConverter : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var ratio = value as MediaRatio;
            if (ratio != null)
            {
                return ((double)ratio.Numerator / ratio.Denominator).ToString("0");
            }
            else return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
